<div class="main">
    <div class="main-nav fl">
        <ul class="nave nav-tabs container">
            <li><a href="/task">任务大厅</a></li>
            <li><a href="smission.html">我的任务</a></li>
            <?php if($user->user_identity==1){ ?>
            <li><a href="#">绑定买号</a></li>
            <?php }elseif($user->user_identity==2){ ?>
            <li><a href="/task/bindtb">绑定店铺</a></li>
            <li class="active"><a href="javascript:void(0)">发布任务</a></li>
            <?php } ?>
        </ul>
    </div>
    <div class="task-wrap container hid">
        <ul class="nave  naven nav-pills operate-nav mt15">
            <li class="">
                <div class="search-wrap">
                    <form class="form-horizontal search-form" action="" method="post">
                        <select class="form-control input-3x fl" name="type" id="type">
                            <option value="0">任务类型</option>
                            <option value="1">淘宝单</option>
                            <option value="2">京东单</option>
                            <option value="3">淘宝浏览单</option>
                            <option value="4">京东浏览单</option>
                            <option value="5">团购单</option>
                            <option value="6">注册单</option>
                        </select>
                        <a href="javascript:void(0)" onclick="releaseTask()">
                            <input class="btn btn-search ml10" value="新建任务" type="button">
                        </a>
                        <select class="form-control input-3x input-3xn" name="searchKey">
                            <option value="taskNo">任务编号</option>
                            <option value="sellerNick">掌柜名称</option>
                        </select>
                        <input class="form-control input-4x" name="searchWords" value="" type="text">
                        <input class="btn btn-search" value="搜索" type="submit">
                    </form>
                </div>
            </li>
        </ul>
        <div class="data-table main-list">
            <table>
                <colgroup>
                    <col width="10%">
                    <col width="20%">
                    <col width="10%">
                    <col width="10%">
                    <col width="20%">
                    <col width="10%">
                    <col width="20%">
                </colgroup>
                <thead>
                <tr class="list-head">
                    <th>任务主图</th>
                    <th>任务编号</th>
                    <th>任务金额</th>
                    <th>任务佣金</th>
                    <th>任务需求</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach($taskTemplate as $item){ ?>
                <tr class="task-list">
                    <td colspan="7">
                        <div class="data-table task-info">
                            <table>
                                <colgroup>
                                    <col width="10%">
                                    <col width="20%">
                                    <col width="10%">
                                    <col width="10%">
                                    <col width="20%">
                                    <col width="10%">
                                    <col width="20%">
                                </colgroup>
                                <tbody>
                                <tr class="head">
                                    <td colspan="7">任务类型：<?php if($item->t->task_type==1){ ?>淘宝<?php }elseif($item->t->task_type==2){ ?>京东<?php } ?>&nbsp;&nbsp;任务摘要：<?php echo $item->t->task_summary; ?></td>
                                </tr>
                                <tr class="body">
                                    <td> <img class="img-thumbnail" style="width:80px;height:80px;" src="<?php echo $item->t->task_goods_picture; ?>" /> </td>
                                    <td>
                                        <p><?php echo $item->t->task_serial; ?></p>
                                        <p>掌柜名: <?php echo $item->s->shop_keeper; ?></p>
                                    </td>
                                    <td><b class="orange f22"><?php echo $item->t->task_total_price; ?></b></td>
                                    <td><b class="orange f22"><?php echo $item->t->task_commission; ?></b></td>
                                    <td>
                                        <p>
                                            <?php if($item->t->task_type==1){ ?>
                                                <?php if($item->t->task_buyer_level==1){ ?><img src="/static/images/level1.png" />
                                                <?php }else{ ?><img src="/static/images/level<?php echo $item->t->task_buyer_level; ?>.gif" /><?php } ?>
                                            <?php }elseif($item->t->task_type==2){ ?>
                                            <?php } ?>
                                        </p>
                                        <p>
                                            <span class="btn btn-tag"><?php if($item->t->task_pay_type==1){ ?>垫付<?php }elseif($item->t->task_pay_type==2){ ?>远程<?php } ?></span>
                                            <span class="btn btn-tag"><?php echo $item->t->task_return_time; ?>小时返</span>
                                            <span class="btn btn-tag">
                                                <?php if($item->t->task_return_type==1){ ?>余额
                                                <?php }elseif($item->t->task_return_type==2||$item->t->task_return_type==4){ ?>支付宝
                                                <?php }elseif($item->t->task_return_type==3){ ?>财付通
                                                <?php }elseif($item->t->task_return_type==5){ ?>其他<?php } ?>
                                            </span>
                                        </p>
                                    </td>
                                    <td>
                                        <p><?php if($item->t->task_is_release==1){ ?>已上架<?php }elseif($item->t->task_is_release==2){ ?>已下架<?php } ?></p>
                                        <p>库存:<?php echo $item->t->task_num; ?>单</p>
                                    </td>
                                    <td class="operate">
                                        <div class="btn-group btn-group-justified">
                                            <a class="btn btn-orange" data-id="34397" href="javascript:void(0)" onclick="editTemplate(<?php echo $item->t->task_id; ?>,<?php echo $item->t->task_type; ?>)">编辑</a>
                                            <?php if($item->t->task_is_release==1){ ?><a class="btn btn-red ajax-get" href="javascript:void(0)" onclick="operate(<?php echo $item->t->task_id; ?>,2)">下架</a>
                                            <?php }elseif($item->t->task_is_release==2){ ?><a class="btn btn-green ajax-get" href="javascript:void(0)" onclick="operate(<?php echo $item->t->task_id; ?>,1)">上架</a><?php } ?>
                                            <a class="btn btn-gray ajax-get confirm" href="javascript:void(0)" onclick="deleteTemplate(<?php echo $item->t->task_id; ?>)">删除</a>
                                        </div>
                                        <p class="update-num"> <a class="btn btn-block " href="javascript:void(0)" onclick="editNum(<?php echo $item->t->task_id; ?>)">更新库存</a> </p>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </td>
                </tr>
                <?php } ?>
                </tbody>
            </table>
        </div>
        <div class="cf">
            <div class="page"> </div>
        </div>
    </div>
</div>

<div class="expte">
    <div class="bg aui_outer">
        <table class="aui_border">
            <tbody class="winr">
            <tr>
                <td class="aui_nw"></td>
                <td class="aui_n"></td>
                <td class="aui_ne"></td>
            </tr>
            <tr>
                <td class="aui_w"></td>
                <td class="aui_c">
                    <div class="aui_inner">
                        <table class="aui_dialog">
                            <tbody>
                            <tr>
                                <td colspan="2" class="aui_header">
                                    <div class="aui_titleBar">
                                        <div style="" class="aui_title aui_titlen fl">提示信息<a style="display: block;" class="aui_close ff" href="javascript:void(0)">×</a></div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: auto; height: auto;" class="aui_main">
                                    <div style="padding: 0px;" class="aui_content">
                                        <div style="display: block;height:10px;" class="buyn"></div>
                                        <div id="proinfo" style="margin-bottom:10px;text-align:center;">内容</div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="aui_footer">
                                    <div class="aui_buttons false">
                                        <input class="btn btn-search" value="确定" type="button" />
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </td>
                <td class="aui_e"></td>
            </tr>
            <tr>
                <td class="aui_sw"></td>
                <td class="aui_s"></td>
                <td style="cursor: se-resize;" class="aui_se"></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="jine">
    <div class="bg aui_outer">
        <table class="aui_border">
            <tbody class="winr">
            <tr>
                <td class="aui_nw"></td>
                <td class="aui_n"></td>
                <td class="aui_ne"></td>
            </tr>
            <tr>
                <td class="aui_w"></td>
                <td class="aui_c">
                    <div class="aui_inner">
                        <table class="aui_dialog">
                            <tbody>
                            <tr>
                                <td colspan="2" class="aui_header">
                                    <div class="aui_titleBar">
                                        <div style="" class="aui_title aui_titlen fl">更新库存<a style="display: block;" class="aui_close ff" href="javascript:void(0)">×</a></div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: auto; height: auto;" class="aui_main">
                                    <div style="padding: 0px;" class="aui_content">
                                        <div style="display: block;height:10px;" class="buyn"></div>
                                        <div id="proinfo" style="margin-bottom:10px;text-align:center;">
                                            <form id="taskNum" action="/ajax/updatetemplate" method="post">
                                                数量：<input type="text" name="task_num" />
                                                <input type="hidden" id="taskId" name="task_id" />
                                            </form>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="aui_footer">
                                    <div class="aui_buttons false">
                                        <input class="btn btn-search update" value="确定" type="button" />
                                        <input class="btn btn-search btn-orange" value="取消" type="button" />
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </td>
                <td class="aui_e"></td>
            </tr>
            <tr>
                <td class="aui_sw"></td>
                <td class="aui_s"></td>
                <td style="cursor: se-resize;" class="aui_se"></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript" src="/static/js/tasktemplate.js"></script>